<div>
<h1>Delete Requests</h1>

<table class="edits-table">
  <tr>
    <th>Entry</th>
    <th>Edited</th>
    <th>Edited On</th>
    <th>Edited By</th>
    <th>Reason</th>
    <th>Moderated On</th>
    <th>Comment</th>
    <th>Approved</th>
    <th>Controls</th>
  </tr>

<% @requests.each do |request| %>
  <tr>

    <td>
    <% if request.editable.class.to_s == 'Image' %>
      <%= link_to request.editable.photographable, request.editable.photographable %>
    <% else %>
      <%= link_to request.editable, request.editable %>
    <% end %>
    </td>

    <td><%=h request.change %></td>
    <td><%=h request.created_at.strftime('%d-%m-%y') %></td>
    <td><%= link_to request.user.username, user_path(request.user) %></td>
    <td><%=h request.reason %></td>
    <td><%=h request.updated_at.strftime('%d-%m-%y') %></td>
    <td><%=h request.comment %></td>
    <td><%=h request.approved %></td>
    <td><%= link_to 'Moderate', edit_delete_request_path(request) %></td>
  </tr>
<% end %>

</table>
</div>
